package by.onlinernews.newsfull;

import by.onlinernews.newslist.PageFragment;
import by.onlinernews_0_1.R;
import by.onlinernews_0_1.R.id;
import by.onlinernews_0_1.R.layout;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import android.widget.ImageView;

public class ImageActivity extends ActionBarActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);	
		setContentView(R.layout.show_image_activity);
		getSupportActionBar().setHomeButtonEnabled(true);
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);
		ImageView iv = (ImageView) findViewById(R.id.iv_full);
		
		Intent intent = getIntent();
		String link = intent.getStringExtra("image_link");
		
		
		PageFragment.setImage(iv, link, this);
		
	}
	@Override
    public boolean onOptionsItemSelected(MenuItem item) {
 
   	 switch(item.getItemId())
	  {
	  case android.R.id.home: {
		  onBackPressed();
		   }
	  }
        return super.onOptionsItemSelected(item);
    }
	
	
}
